#import "ViewerPaneExtra.h"
#import "AppleMail/TableViewManager.h"
#import "FunkyDog.h"
//Every ViewPanerExtra is associated with one MessageTilingView.
//When the the notesview is removed from a window (i think) we can post a notification to FunkyDog to post its dismissal
//Else we have memory leaks.

@class LibraryMessage;
@implementation ViewerPaneExtra
-(id) init {
	self=[super init];
	[NSBundle loadNibNamed: @"special" owner: self];
	[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(noteviewmovedtowindow:) name:SGNoteViewAddedToWindow object:nil];
	return self;
}
-(void)setnotesviews:(SGTagView*)v{
	[v retain];
	[notesview release];
	notesview=v;
}
-(void)dealloc
{
	[[NSNotificationCenter defaultCenter] removeObserver:self name:SGNoteViewAddedToWindow object:nil];
	[notesview release];
	[super dealloc];
}
-(SGTagView*)notesview { return notesview ;}
-(void)noteviewmovedtowindow:(NSNotification*)n{
	if( [n object]==notesview){
	[ [[FunkyDog sharedInstance] tagviewinfodic] setObject:self forKey: [NSNumber  numberWithUnsignedInt:[[notesview window] hash]]];
	}
}
-(void)selectionchangedupdatetag:(NSArray *)selection{
	if (!( [selection count ]> 1 || [selection count]==0)){
	//	id mess=[selection objectAtIndex:0];
//		
//		[notes setStringValue:[mess allHeaders]];
	}
}
@end
